Sheet

A look at the original data provided

data downloaded from https://divvy-tripdata.s3.amazonaws.com/index.html Provided by the client Cyclistic

import pandas as pd
df = pd.read_csv("/data/workspace_files/2021 Data/202109-divvy-tripdata.csv")

A brief look at 2021 data

df.head()
df.describe()
df.isnull().sum()

A brief look at 2020 data

df1=pd.read_csv("/data/workspace_files/2020 Data/202010-divvy-tripdata.csv")
df1.head()
df1.describe()
df1.isnull().sum()
df1.dtypes
newdata=pd.concat([df, df1])
newdata.describe()
df=pd.read_csv("/data/workspace_files/2020 Data/202012-divvy-tripdata.csv")
df.head(3)
df.describe()
df.dtypes
df.start_station_id.unique()
df.isnull().sum()
df.start_lat.nunique()
34343
df.member_casual.value_counts()
df.rideable_type.value_counts()
casual=df[df.member_casual == 'casual']
casual.head()
casual.isnull().sum()
Q420=pd.concat([newdata, df])
Q420.head()
Q420.describe()
Q420.to_csv("/data/workspace_files/2020 Data/Q42020.csv")
import plotly.express as px
df=pd.read_csv("/data/workspace_files/2020 Data/Q42020.csv")
df.head()
/opt/python/envs/default/lib/python3.8/site-packages/IPython/core/interactiveshell.py:3172: DtypeWarning:

Columns (6,8) have mixed types.Specify dtype option on import or set low_memory=False.


df.start_station_id = df.start_station_id.astype(str)
df.end_station_id = df.end_station_id.astype(str)
df.dtypes
df.to_csv("/data/workspace_files/2020 Data/Q42020.csv")
df=pd.read_csv("/data/workspace_files/2020 Data/Q42020.csv")
df.drop(columns=["Unnamed: 0""Unnamed: 0.1"], inplace=True)
df.head()
/opt/python/envs/default/lib/python3.8/site-packages/IPython/core/interactiveshell.py:3172: DtypeWarning:

Columns (7,9) have mixed types.Specify dtype option on import or set low_memory=False.


df.drop(columns=["Unnamed: 0""Unnamed: 0.1"], inplace=True)
df.head()
df.dtypes
members=df.groupby(df.rideable_type)
ValueError: Produced output is too large (16940390 bytes) and cannot be displayed. Consider saving it to a file.
Layer 1 Layer 1 Created using FigmaCreated using Figma ic-unifiedSplitView-2 Created using Figma Group ic-key Created using Figma Layer 1